package steed.util.wechat;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import steed.domain.wechat.WechatUser;

public interface WechatLoginCallBack {
	/**
	 * 
	 * @param request
	 * @param response
	 * @param user 登陆的微信用户
	 * @param preUrl 登陆之前url,建议response.sendRedirect(preUrl); 做静默登陆,用户登陆之前访问哪个网页,登陆后跳转回哪个网页,体验极佳
	 */
	public default void onLogin(HttpServletRequest request,HttpServletResponse response,WechatUser user,String preUrl) {
		try {
			response.sendRedirect(preUrl);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
